package main

import "fmt"

// 结构体嵌套
type Person struct {
	name string
	age  int
}

type student struct {
	p     Person
	score float32
}

type student2 struct {
	Person
	score float32
}

func main() {
	s := student{
		Person{
			"lixiangyang",
			43,
		},
		132.5,
	}

	fmt.Println(s.p.age)
	fmt.Println(s.p.name)

	s2 := student{
		Person{
			"lixiangyang2",
			43,
		},
		132.5,
	}
	fmt.Println(s2.p.name)
}


